package com.ibeeking.gmc.global.service.common.enums;

public enum DatasourceTypeEnum {
    DATASOURCE_TYPE_TEMPLATE(0, "模板数据库源"),
    DATASOURCE_TYPE_TENANT(1, "租户数据库源");

    private Integer type;
    private String desc;

    DatasourceTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDescByType(Integer type) {
        for (DatasourceTypeEnum enumObj : values()) {
            if (enumObj.getType().equals(type)) {
                return enumObj.getDesc();
            }
        }
        return null;
    }
}
